package com.cskaoyan.market.controller.admin;

import com.cskaoyan.market.annotation.RequiresPermissionsDesc;
import com.cskaoyan.market.db.domain.MarketFootprint;
import com.cskaoyan.market.service.AdminFootprintService;
import com.cskaoyan.market.util.ResponseUtil;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServlet;
import java.io.IOException;
import java.util.List;

@RestController
@RequestMapping("/admin/footprint")
public class AdminFootprintController extends HttpServlet {

    @Autowired
    AdminFootprintService adminFootprintService;


    @GetMapping("list")
    @RequiresPermissions("admin:footprint:list")
    @RequiresPermissionsDesc(menu = {"会员管理", "会员足迹"},button = "查询")
    public Object list(Integer page, Integer limit, String sort, String order, Integer goodsId,Integer userId) throws IOException {

        List<MarketFootprint> footprintList = adminFootprintService.list(page,limit,userId,goodsId,sort,order);
        return ResponseUtil.okList(footprintList);
    }

}
